import { React, useState } from 'react';

export default function Hello() {
    let [msg] = useState('卧槽无情');
    const name = 'Josh';
    const element = (<h1>我是元素，我居然能这样用 {name}</h1>);
    const user = {
        firstName: 'Helen',
        lastName: 'keller'
    };
    return (
        <div>
            我是Hello组件
            <div>{msg}</div>
            <div>{element}</div>
            <div>{formatName(user)}</div>
            <div tabIndex={999}>{['哈哈', 'tamade']}</div>
            {
                false ?
                    (<h3>我是宝宝</h3>) :
                    (<h2>大帅</h2>)
            }
            <Welcome name="Bob" />
            <Welcome name="小明" />
            <Welcome name="小李"></Welcome>
        </div>
    );
}
function formatName(user) {
    return ''.concat(user.firstName, ' ', user.lastName);
}

function Welcome(props) {
    return (<div>Hello, {props.name}</div>);
}